import request from '@/utils/request'
import { faceApiUrl,contractApiUrl} from '../config'

// 分包结算


/**
 * 分页查询
 * @param {Object} data
 */
export function getSettlementList(data) {
  return request({
    url: `${faceApiUrl}/commercialSubpackageAccount/getPageCommercialSubpackageAccount`,
    method: 'post',
    data: data
  })
}

/**
 * 列表汇总信息
 * @param {Object} data
 */

 export function getTopTotal(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/getTopTotal`,
      method: 'post',
      data: data
    })
  }

/**
 * 列表删除
 * @param {Object} data
 */
export function delSettlementList(data) {
    return request({
    url: `${faceApiUrl}/commercialSubpackageAccount/deleteByPrimaryKey/${data.id}`,
      method: 'get',
    })
  }

      /**
 * 作废
 * @param data
 */
export function settlementRevoke(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/Revoke/${data.id}`,  
      method: 'get',
    })
    }
  
        /**
   * 详情
   * @param data
   */
  export function getSettlementById(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/getCommercialSubpackageAccountById`,  
      method: 'get',
      params: data
    })
    }

/**
 * 新增
 * @param data
 */

  export function addSettlement(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/insertSelective`,
      method: 'post',
      data: data
    })
  }

/**
 * 编辑
 * @param data
 */

export function editSettlement(data) {
  return request({
    url: `${faceApiUrl}/commercialSubpackageAccount/updateByPrimaryKeySelective`,
    method: 'post',
    data: data
  })
}

/**
 * 分公司代办提交
 * @param data
 */

 export function addSettlementBomCommission(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/bomCommission`,
      method: 'post',
      data: data
    })
  }

  /**
 * 公司代办提交
 * @param data
 */

 export function addSettlementComCommission(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/comCommission`,
      method: 'post',
      data: data
    })
  }

  /**
 * 获取已结算金额（含税）（万元）
 * @param data
 */

   export function getSettledAmount(data) {
    return request({
      url: `${faceApiUrl}/commercialSubpackageAccount/getSettledAmount`,
      method: 'post',
      data: data
    })
  }

    /**
 * 获取分包商退场时间
 * @param data
 */

    export function getSccByProjectIdForAppearanceDate(data) {
    return request({
      url: `${contractApiUrl}/contractNew/getSccByProjectIdForAppearanceDate`,
      method: 'post',
      data: data
    })
  }
  

